

var e = "<i class='fa fa-times-circle'></i> "; //表单验证错误的“x”图标
var url_web="http://192.168.1.148:8087/";
$.validator.addMethod("pwd", function(value, element, param){
    //方法中又有三个参数:value:被验证的值， element:当前验证的dom对象，param:参数(多个即是数组)
//      console.log(value + "," + $(element).val() + "," + param );
    return new RegExp(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,}$/).test(value);
});

// 重发倒计时方法
var countdown=5;
function settime(obj,tips) {
    console.log('11');
    if (countdown == 0) {
        obj.find('button').removeAttr("disabled");
        /*if(obj.find('input').length>1){
            obj.find("input:eq(1)").addClass("hidden");
            obj.find("input:eq(2)").parent().removeClass("hidden");
        }*/
        obj.find('h2').text(tips[0]);
        obj.find('p').text(tips[1]);
        obj.find("button:eq(0)").text("重新发送");
        countdown = 5;
        return;
    } else {
        obj.find("button:eq(0)").text("重新发送(" + countdown + ")");
        countdown--;
    }
    setTimeout(function() {
            settime(obj,tips) }
        ,1000)
}

//获取url中"?"符后的字串
function GetRequest() {
    var url = location.search;
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}
